// 用户相关的 Mock 数据

// 用户角色类型
export const USER_ROLES = {
  PATIENT: '患者',
  DOCTOR: '医生',
  NURSE: '护士',
  ADMIN: '管理员'
} as const;

// 科室信息
export const DEPARTMENTS = {
  INTERNAL: '内科',
  SURGERY: '外科',
  PEDIATRICS: '儿科',
  GYNECOLOGY: '妇科',
  EMERGENCY: '急诊科',
  CARDIOLOGY: '心内科',
  NEUROLOGY: '神经内科'
} as const;

// 模拟用户列表
export const mockUsers = [
  {
    id: 1,
    phone: '123456',
    name: '张三',
    avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=123456',
    role: USER_ROLES.PATIENT,
    department: DEPARTMENTS.INTERNAL,
    email: 'zhangsan@example.com',
    lastLoginTime: new Date().toISOString()
  },
  {
    id: 2,
    phone: '13800138000',
    name: '李医生',
    avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=doctor',
    role: USER_ROLES.DOCTOR,
    department: DEPARTMENTS.CARDIOLOGY,
    email: 'doctor.li@hospital.com',
    lastLoginTime: new Date().toISOString()
  },
  {
    id: 3,
    phone: '13900139000',
    name: '王护士',
    avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=nurse',
    role: USER_ROLES.NURSE,
    department: DEPARTMENTS.EMERGENCY,
    email: 'nurse.wang@hospital.com',
    lastLoginTime: new Date().toISOString()
  }
];

// 获取用户信息
export const getUserById = (id: number) => {
  return mockUsers.find(user => user.id === id);
};

// 获取用户列表
export const getUsersByRole = (role: string) => {
  return mockUsers.filter(user => user.role === role);
};

// 获取科室用户列表
export const getUsersByDepartment = (department: string) => {
  return mockUsers.filter(user => user.department === department);
};
